﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="UCComments.ascx.cs" Inherits="Controls_UCComments" %>
<script type="text/javascript">
    $(window).load(function () {
        if (location.href.indexOf("#comments") > -1) {
            $('html,body').animate({ scrollTop: $("#comments").offset().top });
        }

    });
    $(document).ready(function () {
        $(".replythis").click(function () {
            var e = $(this);
            $('html,body').animate({ scrollTop: $("#comments").offset().top }, function () {
                $("#<%= hfreplyto.ClientID %>").val(e.attr('title'));
                $(".contentreply").hide()
                $(".contentreply").html(e.parent().parent().parent().parent().children('.comment_box_inner_tc_r').children('ul').children('.comment_user_wro').children('p').html());
                $(".contentreply").slideDown();
                $("#cancel-comment-reply-link").show();
            });

        });

        $("#cancel-comment-reply-link").click(function () {
            $(".contentreply").slideUp();
            $(".contentreply").html("");
            $("#<%= hfreplyto.ClientID %>").val("0");
            $(this).fadeOut();
        });

        //        $(".deleteCom").click(function () {
        //            var strURL = "<%= KTFrameworkCus.Globals.ApplicationPath %>dms/Ajax/dms-Ajax.asmx/DeleteComment";
        //            imageid = $(this).attr('id');
        //            $.ajax({
        //                url: strURL,
        //                type: 'POST',
        //                data: "commentID=" + imageid,
        //                datatype: "Text",
        //                success: function (msg) {
        //                    $("a#" + imageid).parent().parent().parent().parent().parent().slideUp('400', function () {
        //                        $(this).remove();
        //                    })
        //                }
        //            });
        //        });

    });
</script>
<style type="text/css">
    #cancel-comment-reply-link:hover
    {
        cursor: pointer;
    }
    #cancel-comment-reply-link
    {
        margin-top: 5px;
        font-size: 10px;
        color: red;
        font-weight: bold;
        display: block;
    }
    .contentreply
    {
        padding-left: 10px;
        color: #8e8e8e;
    }
</style>
<div class="comment">
    <h4>
        Bình luận</h4>
    <div id="commentti" runat="server">
    </div>
    <asp:Literal ID="ltCommentList" runat="server"></asp:Literal>
    <div class="clear">
    </div>
</div>
<div class="form_comment" id="comments">
   
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <h4>
                Gửi Bình Luận</h4>
            <div class="form_comment_inner">
                <asp:MultiView ID="MultiView1" runat="server">
                    <asp:View ID="vChuaDangNhap" runat="server">
                        <div>
                            Vui lòng đăng nhập để có thể đăng bình luận.</div>
                    </asp:View>
                    <asp:View ID="vDaDangNhap" runat="server">
                        <p class="contentreply">
                        </p>
                        <p class="cancel-comment-reply">
                            <a rel="nofollow" id="cancel-comment-reply-link" style="display: none;">Bấm vào đây
                                để hủy bài mà bạn muốn trả lời.</a></p>
                        <div class="form_comment_input_label">
                            <ul class="name_input">
                                <li>Tên<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="RequiredFieldValidator"
                                    Text="*" ControlToValidate="txtten" ValidationGroup="com"></asp:RequiredFieldValidator></li>
                                <li>
                                    <asp:TextBox ID="txtten" runat="server"></asp:TextBox></li>
                            </ul>
                            <ul class="email_input">
                                <li>Email<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
                                    ErrorMessage="RequiredFieldValidator" Text="*" ControlToValidate="txtemail" ValidationGroup="com"></asp:RequiredFieldValidator></li>
                                <li>
                                    <asp:TextBox ID="txtemail" runat="server"></asp:TextBox></li>
                            </ul>
                        </div>
                        <div class="form_comment_input_text">
                            <ul>
                                <li>
                                    <asp:TextBox ID="txtnhanxet" TextMode="MultiLine" runat="server" Width="380px" Height="180px"></asp:TextBox>
                                </li>
                                <li>
                                    <asp:Button CssClass="btn_comment_send" ValidationGroup="com" ID="Button1" OnClick="btnComment_Click"
                                        runat="server" Text="Gửi" />
                                    <asp:HiddenField ID="hfPostID" runat="server" />
                                    <asp:HiddenField ID="hfreplyto" Value="0" runat="server" />
                                </li>
                                <li>
                                    <asp:Label ID="lbmesse" runat="server" Style="float: left; padding-top: 10px;" Font-Bold="True"
                                        ForeColor="Red" Font-Size="12px"></asp:Label>
                                </li>
                            </ul>
                        </div>
                    </asp:View>
                </asp:MultiView>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</div>
